package com.gzy.rpsm_property.service;

import com.github.pagehelper.Page;
import com.gzy.rpsm_property.pojo.*;
import org.apache.ibatis.annotations.Select;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Optional;

public interface UserService {
    int insertUser(User user) throws DuplicateKeyException,Exception;
    int changeUser(User user);
    User queryById(int id);
    PageResult<User> pageOfOwner(int current, int size);

    List<Amount> getUnpaidAmountsByRoomId(Integer roomId);
//     boolean authenticate(String username, String password);
    User login(String account, String password);
//    Page<UnpaidAmount> getUnpaidAmountsByRoomId(Integer roomId, int page, int size);
public Page<Amount> getUnpaidAmountsByRoomId(Integer roomId, int page, int size);
    public int payAmount(int amountId);
    List<Ms> getAllMessagesWithUserDetails();


    Optional<User> getUserByUsername(String username);

     int activateUser(int userid);

}
